Skip to content

[ci] simplify release workflow.#13329

Merged
sayakpaul merged 11 commits intomainfrom
overhaul-release-workflow
Apr 24, 2026
Merged

[ci] simplify release workflow.#13329
sayakpaul merged 11 commits intomainfrom
overhaul-release-workflow

Conversation

@sayakpaul
Copy link
Copy Markdown
Member

What does this PR do?

Simplify release workflow like https://github.com/huggingface/transformers/blob/main/.github/workflows/release.yml.

  • Removed Test PyPI — no longer publish to Test PyPI and install from there; instead, install directly from the locally built wheel to validate.
  • Two-job structure: build-and-test (find release branch, build, install from wheel, run import tests) -> publish-to-pypi (download artifacts, publish).
  • Manual approval gate via GitHub Environment pypi-release with required reviewers — publishing pauses until a maintainer approves.
  • OIDC trusted publishing using pypa/gh-action-pypi-publish — replaces Twine username/password secrets.
  • Fixed deprecated ::set-output — no longer needed since branch resolution happens in the same job.

I have taken care of the following config setups to make it work:

  • Create a GitHub Environment called pypi-release with required reviewers (Dhruv, Yiyi, and myself).
  • Configure PyPI trusted publishing for the huggingface/diffusers repo, specifying the pypi-release environment.

@sayakpaul sayakpaul requested a review from DN6 March 25, 2026 04:04
Comment thread .github/workflows/pypi_publish.yaml Outdated
pip install -U torch --index-url https://download.pytorch.org/whl/cpu

- name: Build the dist files
run: python setup.py bdist_wheel && python setup.py sdist
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit. Running commands like this with setup.py is deprecated in favour of just running a single
python -m build which gives you both the sdist and the wheel
https://setuptools.pypa.io/en/latest/deprecated/commands.html#running-setuptools-commands

Think we can just use that here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice one. Updated.

@sayakpaul sayakpaul requested a review from DN6 March 25, 2026 05:10
@sayakpaul
Copy link
Copy Markdown
Member Author

@DN6 a gentle ping.

@github-actions github-actions Bot added CI size/M PR with diff < 200 LOC labels Apr 12, 2026
Comment thread .github/workflows/pypi_publish.yaml Outdated
Comment thread .github/workflows/pypi_publish.yaml Outdated
Comment thread .github/workflows/pypi_publish.yaml
Comment thread .github/workflows/pypi_publish.yaml
Comment thread .github/workflows/pypi_publish.yaml
Comment thread .github/workflows/pypi_publish.yaml Outdated
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
@sayakpaul sayakpaul requested a review from DN6 April 22, 2026 13:07
@sayakpaul
Copy link
Copy Markdown
Member Author

@DN6 all your comments should have been addressed. Check now.

Copy link
Copy Markdown
Collaborator

@DN6 DN6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍🏽

name: python-dist
path: dist/

- name: Publish package distributions to TestPyPI
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Publish package distributions to TestPyPI
- name: Publish package distributions to PyPI

- "*"
- v*
branches:
- 'v*-release'
Copy link
Copy Markdown
Collaborator

@DN6 DN6 Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realised we use v*-patch for patch branch names. Not a merge blocker, I would actually prefer it if we just called everything v*-release like transformers moving forward.

@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 24, 2026
@sayakpaul sayakpaul merged commit dad80d7 into main Apr 24, 2026
12 of 16 checks passed
@sayakpaul
Copy link
Copy Markdown
Member Author

Failing tests are so unrelated!

@sayakpaul sayakpaul deleted the overhaul-release-workflow branch April 24, 2026 22:56
terarachang pushed a commit to terarachang/diffusers that referenced this pull request Apr 30, 2026
* simplify release workflow.

* up

* trigger on branches too.

* restrict permissions to read.

* use sha

* remove determination step of latest branch

* resolve rest
ghostxsl pushed a commit to ghostxsl/diffusers that referenced this pull request May 6, 2026
* simplify release workflow.

* up

* trigger on branches too.

* restrict permissions to read.

* use sha

* remove determination step of latest branch

* resolve rest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI size/M PR with diff < 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants